<template>
	<view class="box-card-main">


		<!-- 导航栏 -->
		<u-sticky :customNavHeight='homeTop-10'>
			<view @touchmove.stop.prevent class="mb-10 pos-r bg-white shadow-1">
				<view class="flex ac sb pb-20">
					<!-- 导航栏 -->
					<view id='nav' class="box-tabs-optimized">
						<scroll-view scroll-x="true" show-scrollbar="false" class="nav-scroll-view">
							<view class="nav-scroll-content">
								<view @click="selectType(0)" class="box-tab-item" :class="{'box-tab-active': currentType==0}">
									<view class="box-tabs-txt">
										<text :style="{color:currentType==0?'#0808D8':''}">供需</text>
										<text>信息</text>
									</view>
									<view v-if="currentType == 0" class="tab-indicator">
										<image src="https://yjgs.jsonbug.com/test/wx-tabls-select.png"
											style="width: 50rpx;height: 15rpx;">
										</image>
									</view>
								</view>
								
								<view @click="selectType(1)" class="box-tab-item" :class="{'box-tab-active': currentType==1}">
									<view class="box-tabs-txt">
										<text :style="{color:currentType==1?'#0808D8':''}">链接</text>
										<text>人脉</text>
									</view>
									<view v-if="currentType == 1" class="tab-indicator">
										<image src="https://yjgs.jsonbug.com/test/wx-tabls-select.png"
											style="width: 50rpx;height: 15rpx;">
										</image>
									</view>
								</view>
								
								<view @click="selectType(2)" class="box-tab-item" :class="{'box-tab-active': currentType==2}">
									<view class="box-tabs-txt">
										<text :style="{color:currentType==2?'#0808D8':''}">新闻</text>
										<text>审核</text>
									</view>
									<view v-if="currentType == 2" class="tab-indicator">
										<image src="https://yjgs.jsonbug.com/test/wx-tabls-select.png"
											style="width: 50rpx;height: 15rpx;">
										</image>
									</view>
								</view>
								
								<view @click="selectType(3)" class="box-tab-item" :class="{'box-tab-active': currentType==3}">
									<view class="box-tabs-txt">
										<text :style="{color:currentType==3?'#0808D8':''}">服务</text>
										<text>审核</text>
									</view>
									<view v-if="currentType == 3" class="tab-indicator">
										<image src="https://yjgs.jsonbug.com/test/wx-tabls-select.png"
											style="width: 50rpx;height: 15rpx;">
										</image>
									</view>
								</view>
								
								<view @click="selectType(4)" class="box-tab-item" :class="{'box-tab-active': currentType==4}">
									<view class="box-tabs-txt">
										<text :style="{color:currentType==4?'#0808D8':''}">平台</text>
										<text>反馈</text>
									</view>
									<view v-if="currentType == 4" class="tab-indicator">
										<image src="https://yjgs.jsonbug.com/test/wx-tabls-select.png"
											style="width: 50rpx;height: 15rpx;">
										</image>
									</view>
								</view>
							</view>
						</scroll-view>
					</view>
					<!-- end -->
				</view>

			</view>
		</u-sticky>
		<!-- end -->

		<!-- 供需审核 -->
		<block v-if='currentType == 0'>
			<view v-for="(item,index) in sendList" :key="index" class=" bg-white bb p-20 br-6 shadow-1">
				<view class="flex ac sb">
					<view class="flex">
						<view>
							<image class="br-100p" :src="item.avatar" mode="aspectFill"
								style="width: 80rpx;height: 80rpx;"></image>
						</view>
						<view class="ml-10 mt-5">
							<view>
								<text class="fw fs-30">{{item.name || ''}}</text>
								<text class="ml-10 mr-10">/</text>
								<text class="fs-24 c-666">{{item.position || ''}}</text>
								<text v-if="item.is_real == 2" class="iconfont-yjgs c-999 ml-10">&#xe6eb;</text>
								<text v-if="item.is_real == 1" class="iconfont-yjgs ml-10"
									style="color: #00009E;">&#xe6eb;</text>
							</view>
							<view class="c-999 mt-5 fs-24 line-1">
								{{item.company_name || ''}}
							</view>
						</view>
					</view>
					<navigator :url="'/pages/extend/connection/index_desc?id='+item.card_id" hover-class="none">
						<view class="box-fast">
							立即联系
						</view>
					</navigator>
				</view>
				<view class="mt-10" style="margin-left: 90rpx;">
					<view class="flex ac">
						<view v-if="item.type == 2" class="box-xq">
							需求
						</view>
						<view v-else class="box-xq"
							style="background-color: #FFE7E6;color: #D22C25;border: 1rpx solid #D22C25;">
							供应
						</view>
						<view class="fw fs-32 ml-10 line-3" style="width: 80vw;">
							{{item.title || ''}}
						</view>
					</view>
					<view class="mt-10 ">
						<u-read-more toggle :showHeight='140' textIndent='0em'>
							<view>
								<text class="fs-28">
									{{item.content}}
								</text>
							</view>
						</u-read-more>
					</view>
					<view v-if="item.images" class="mt-20 box-img-for">
						<view @click="$timer.preView($timer.strToArr($timer.ensureUrl(item.images)),_index)"
							v-for="(obj,_index) in $timer.strToArr($timer.ensureUrl(item.images))" :key="_index"
							class="mb-5 mr-15">
							<image class="br-6" style="height: 160rpx;width: 160rpx;" :src="obj" mode="aspectFill">
							</image>
						</view>
					</view>
					<view class="flex ac">
						<view class="mr-10">
							<text class="fs-24 c-999">{{$timer.formatTime(item.create_time) || ''}}</text>
						</view>
						<view class="ml-50">
							<text class="iconfont icon-pinglun3"></text>
							<text class="ml-5 fs-24">{{item.comment_num || 0}}</text>
						</view>
						<view class="ml-50">
							<text class="iconfont icon-shoucang2"></text>
							<text class="ml-5 fs-24">{{item.follow_num || 0}}</text>
						</view>
						<view class="ml-50">
							<text class="iconfont icon-dianzan1"></text>
							<text class="ml-5 fs-24">{{item.like_num || 0}}</text>
						</view>
						<view @click="extendClick(item)" class="ml-50 box-moreM">
							<text class="iconfont icon-gengduo1"></text>
						</view>
					</view>

				</view>
			</view>
		</block>
		<!-- end -->

		<!-- 名片列表 -->
		<block v-if="currentType == 1">
			<u-swipe-action>
				<u-swipe-action-item v-for="item in dataList" :key="item.id"
					@click='swipeActionClick($event,item)' :options="options">
					<view @click="toPage(item)" class=" bg-white shadow-2  br-12">
						<view class="box-apply">
							<view class="flex ac">
								<view>
									<image :src="$timer.ensureUrl(item.avatar)" mode="aspectFill"
										style="width: 100rpx;height: 100rpx;border-radius: 100%;">
									</image>
								</view>
								<view class="ml-20">
									<view>
										<text class="fw fs-34">{{item.name || ''}}</text>
										<text style="color: #A8A8A8;" class="ml-5 mr-10 fs-30">/</text>
										<text style="color: #A8A8A8;"
											class="fs-26 ">{{item.position.position || ''}}</text>
										<text v-if="item.is_real == 2" class="iconfont-yjgs ml-10 c-666">
											&#xe6eb;
										</text>
										<text v-if="item.is_real == 1" class="iconfont-yjgs ml-10"
											style="color: #00009E;">
											&#xe6eb;
										</text>
									</view>
									<view class="mt-10 ">
										<text class="fs-26"
											style="color: #A8A8A8;">{{item.position.company_name}}</text>
									</view>
								</view>
							</view>
						</view>
						<view style="width: 100%;height: 6px;background-color: #F2F2F2;"></view>
					</view>
				</u-swipe-action-item>
			</u-swipe-action>
		</block>
		<!-- end -->

		<!-- 新闻审核 -->
		<block v-if="currentType == 2">
			<view class="news-list">
				<uni-swipe-action>
					<uni-swipe-action-item :autoClose='false' v-for="(item, index) in articleList" :key="index"
						:threshold="60" :right-options="swipeOptions" @click="handleSwipeClick($event, item)">
						<view class="news-item" @click="toNewsDetail(item)">
							<view class="news-content">
								<image class="news-cover" :src="$timer.ensureUrl(item.cover)" mode="aspectFill"></image>
								<view class="news-info">
									<view class="news-title">
										{{item.title || ''}}
									</view>
									<view class="news-desc">{{item.content || ''}}</view>
									<view class="news-footer">
										<view class="news-label">{{item.label || ''}}</view>
										<view class="news-time">{{item.create_time || ''}}</view>
									</view>
								</view>
							</view>
						</view>
					</uni-swipe-action-item>
				</uni-swipe-action>
			</view>
		</block>
		<!-- end -->

		<!-- 服务审核 -->
		<block v-if="currentType == 3">
			<view class="service-list">
				<uni-swipe-action>
					<uni-swipe-action-item :autoClose='false' v-for="(item, index) in serviceList" :key="index"
						:threshold="60" :right-options="serviceSwipeOptions" @click="handleServiceSwipeClick($event, item)">
						<view class="service-item" @click="viewServiceDetail(item)">
							<view class="service-header">
								<view class="service-info">
									<image class="service-avatar" :src="$timer.ensureUrl(item.avatar)" mode="aspectFill"></image>
									<view class="service-meta">
										<text class="service-name">{{ item.name || '用户' }}</text>
										<text class="service-time">发布时间：{{ $timer.formatTime(item.create_time) }}</text>
									</view>
								</view>
								<view class="service-status" :class="{
									'status-pending': item.status === 2,
									'status-approved': item.status === 1,
									'status-rejected': item.status === 3
								}">{{ getServiceStatusText(item.status) }}</view>
							</view>

							<view class="service-content">
								<image class="service-cover" :src="$timer.ensureUrl(item.cover_image)" mode="aspectFill"></image>
								<view class="service-brief">
									<text class="service-title">{{ item.title || '' }}</text>
									<text class="service-desc">{{ item.des_content || '' }}</text>
									<view class="service-stats">
										<view class="stat-item">
											<text class="iconfont icon-liulan"></text>
											<text>{{ item.see_number || 0 }}</text>
										</view>
										<view class="stat-item">
											<text class="iconfont icon-dianzan1"></text>
											<text>{{ item.like_number || 0 }}</text>
										</view>
									</view>
								</view>
							</view>
							
						</view>
					</uni-swipe-action-item>
				</uni-swipe-action>
			</view>
		</block>
		<!-- end -->

		<!-- 平台反馈审核 -->
		<block v-if="currentType == 4">
			<view class="feedback-list">
				<uni-swipe-action>
					<uni-swipe-action-item :autoClose='false' v-for="(item, index) in feedbackList" :key="index"
						:threshold="60" :right-options="feedbackSwipeOptions" @click="handleFeedbackSwipeClick($event, item)">
						<view class="feedback-item">
							<view class="feedback-header">
								<view class="feedback-type">{{ getFeedbackTypeText(item.type) }}</view>
								<view class="feedback-status" :class="{
									'status-pending': item.status === 2,
									'status-approved': item.status === 1,
									'status-rejected': item.status === 3
								}">{{ getFeedbackStatusText(item.status) }}</view>
							</view>
							<view class="feedback-title">{{ item.title }}</view>
							<view class="feedback-content">{{ item.content }}</view>
							
							<!-- 图片预览 -->
							<view class="feedback-images" v-if="item.images">
								<image 
									v-for="(img, imgIndex) in $timer.strToArr($timer.ensureUrl(item.images)).slice(0, 3)" 
									:key="imgIndex" 
									:src="img" 
									mode="aspectFill" 
									class="feedback-image"
									@click.stop="previewFeedbackImage($timer.strToArr($timer.ensureUrl(item.images)), imgIndex)"
								></image>
								<view class="image-count" v-if="$timer.strToArr($timer.ensureUrl(item.images)).length > 3">
									+{{ $timer.strToArr($timer.ensureUrl(item.images)).length - 3 }}
								</view>
							</view>
							
							<!-- 金额信息 -->
							<view class="feedback-money" v-if="item.money > 0">
								<text class="money-label">成交金额：</text>
								<text class="money-value">¥{{ item.money }}</text>
							</view>
							
							<!-- 建议信息 -->
							<view class="feedback-suggest" v-if="item.suggest">
								<text class="suggest-label">建议/愿景：</text>
								<text class="suggest-content">{{ item.suggest }}</text>
							</view>
							
							<view class="feedback-footer">
								<view class="feedback-user">
									<image class="user-avatar" :src="$timer.ensureUrl(item.avatar || '/static/images/avatar.png')" mode="aspectFill"></image>
									<text class="user-name">{{ item.name || '用户' }}</text>
								</view>
								<view class="feedback-time">{{ $timer.formatTime(item.create_time) }}</view>
							</view>
						</view>
					</uni-swipe-action-item>
				</uni-swipe-action>
				
				<!-- 空数据站位 -->
				<!-- <emptyPage v-if="feedbackList.length === 0" style="margin-top: 0rpx;margin-bottom: 20rpx;">
				</emptyPage> -->
			</view>
		</block>
		<!-- end -->

		<!-- 空数据站位 -->
		<emptyPage v-if="dataList.length == 0 && currentType != 3" style="margin-top: 0rpx;margin-bottom: 20rpx;">
		</emptyPage>
		<emptyPage v-if="serviceList.length == 0 && currentType == 3" style="margin-top: 0rpx;margin-bottom: 20rpx;">
		</emptyPage>
		<!-- end -->


		<u-modal @confirm='confirmClick' @close='cancelClick' @cancel='cancelClick' closeOnClickOverlay showCancelButton
			:show="show">
			<view class="slot-content">
				<textarea v-if="current == 1" auto-height placeholder="请输入驳回内容" v-model="content" maxlength="150"
					show-confirm-bar></textarea>
				<text v-if="current == 0">请确定要通过吗？</text>
			</view>
		</u-modal>

		<!-- 供需对接 扩展 -->
		<u-action-sheet @select='sheetSelect' cancelText='取消' round='12' @close='sheetShow=false' closeOnClickOverlay
			safeAreaInsetBottom :actions="sheetList" :show="sheetShow"></u-action-sheet>
		<!-- end -->


	</view>
</template>

<script>
	import {
		cardCardGetExamineList,
		cardCardInfoExamine,
		UserArticleGetList,
		UserArticleExamine,
		findServiceGetExamineList,
		findServiceExamine,
		PlatformFeedBackGetExamineList,
		PlatformFeedBackExamine
	} from '@/api/extend.js'
	import emptyPage from '@/pages/extend/components/emptyPage.vue'
	import {
		getExamineList,
		examine
	} from '@/api/extend.js'
	export default {
		components: {
			emptyPage
		},
		data() {
			return {
				swipeOptions: [{
					text: '同意',
					style: {
						backgroundColor: '#249444',
						color: '#FFFFFF',
						fontSize: '28rpx'
					}
				}, {
					text: '驳回',
					style: {
						backgroundColor: '#dd524d',
						color: '#FFFFFF',
						fontSize: '28rpx'
					}
				}],
				articleList: [],
				currentStatus: 0,
				sheetList: [{
						name: '同意',
					},
					{
						name: '驳回',
					},
				],
				sheetShow: false,
				sendList: [],
				currentType: 0,
				current: 0, //当前状态 0通过 1驳回
				currentItem: {},
				content: '',
				show: false,
				dataList: [],
				options: [{
					text: '通过',
					style: {
						backgroundColor: '#249444'
					}
				}, {
					text: '驳回',
					style: {
						backgroundColor: '#f56c6c'
					}
				}],
				serviceList: [],
				serviceSwipeOptions: [{
					text: '通过',
					style: {
						backgroundColor: '#249444',
						color: '#FFFFFF',
						fontSize: '28rpx'
					}
				}, {
					text: '驳回',
					style: {
						backgroundColor: '#dd524d',
						color: '#FFFFFF',
						fontSize: '28rpx'
					}
				}],
				feedbackList: [],
				feedbackSwipeOptions: [{
					text: '同意',
					style: {
						backgroundColor: '#249444',
						color: '#FFFFFF',
						fontSize: '28rpx'
					}
				}, {
					text: '驳回',
					style: {
						backgroundColor: '#dd524d',
						color: '#FFFFFF',
						fontSize: '28rpx'
					}
				}],
			}
		},
		onLoad() {
			if (this.currentType == 0) {
				this.cardCardGetExamineListFunc();
			} else if (this.currentType == 1) {
				this.getExamineListFun();
			} else if (this.currentType == 2) {
				this.UserArticleGetListFunc();
			} else if (this.currentType == 3) {
				this.getServiceListFunc();
			} else if (this.currentType == 4) {
				this.getFeedbackListFunc();
			}
		},
		methods: {
			toNewsDetail(item) {
				
				if (item.wx_url) {
					wx.openOfficialAccountArticle({
						url: item.wx_url, // 此处填写公众号文章连接
						success: res => {},
						fail: res => {}
					})
				} else {
					uni.navigateTo({
						url: '/pages/extend/connection/new_desc?id=' + item.id
					})
				}
			},
			handleSwipeClick(e, item) {
				this.current = e.index
				this.currentItem = item
				this.show = true;
			},
			handleServiceSwipeClick(e, item) {
				this.current = e.index
				this.currentItem = item
				this.show = true;
			},
			UserArticleGetListFunc() {
				UserArticleGetList({
					status: 2,
					limit: 20
				}).then(res => {
					this.show = false;
					this.articleList = res.data.data.map((item, index) => {
						let obj = {
							show: 'none',
							...item,
							create_time: uni.$u.timeFormat(item.create_time, 'yyyy-mm-dd'),
						}
						if (index == 0) {
							obj.show = 'none'
						}
						return obj;
					});
				})
			},
			changeStatus(status) {
				this.currentStatus = status;
				this.UserArticleGetListFunc();
			},
			cardCardInfoExamineFunc(obj) {
				cardCardInfoExamine(obj).then(res => {
					if (res.status == 200) {
						this.cardCardGetExamineListFunc();
					}
					this.show = false;
					uni.showToast({
						title: res.message,
						icon: 'none',
						duration: 4000
					})
				})
			},
			sheetSelect(e) {
				if (e.name == '同意') {
					this.current = 0;
					this.show = true;

				} else {
					this.current = 1;
					this.show = true;
				}
			},
			extendClick(item) {
				this.sheetShow = true;
				this.currentItem = item
			},
			cardCardGetExamineListFunc() {
				cardCardGetExamineList().then(res => {
					this.sendList = res.data.data;
				})
			},
			selectType(index) {
				this.currentType = index;
				if (index == 0) {
					this.cardCardGetExamineListFunc();
				} else if (index == 1) {
					this.getExamineListFun()
				} else if (index == 2) {
					this.UserArticleGetListFunc();
				} else if (index == 3) {
					this.getServiceListFunc();
				} else if (index == 4) {
					this.getFeedbackListFunc();
				}
			},
			confirmClick() {

				if (this.currentType == 0) {
					if (this.current == 0) {
						this.cardCardInfoExamineFunc({
							id: this.currentItem.id,
							status: 1
						});
					} else {
						this.cardCardInfoExamineFunc({
							id: this.currentItem.id,
							status: 3,
							remark: this.content
						});
					}
					return;
				}

				if (this.currentType == 1) {
					if (this.current == 1) {
						if (!this.content) {
							uni.showToast({
								title: '请输入驳回内容！',
								icon: 'none'
							})
							return;
						}
						this.examineFunc({
							id: this.currentItem.id,
							status: 3,
							remark: this.content,
						})
					} else {
						this.examineFunc({
							id: this.currentItem.id,
							status: 1,
						})
					}
				}

				if (this.currentType == 2) {
					if (this.current == 0) {
						UserArticleExamine({
							id: this.currentItem.id,
							status: 1,
						}).then(res => {
							uni.showToast({
								title: res.message,
								icon: 'none'
							})
							if (res.status == 200) {
								this.UserArticleGetListFunc();
							}
						}).catch(err =>{
							uni.showToast({
								title: err.message,
								icon: 'none'
							})
						})
					} else {
						UserArticleExamine({
							id: this.currentItem.id,
							status: 3,
							remark: this.content,
						}).then(res => {
							uni.showToast({
								title: res.message,
								icon: 'none'
							})
							if (res.status == 200) {
								this.UserArticleGetListFunc();
							}
						}).catch(err =>{
							uni.showToast({
								title: err.message,
								icon: 'none'
							})
						})
					}
				}

				if (this.currentType == 3) {
					if (this.current == 0) {
						this.serviceCardInfoExamineFunc({
							id: this.currentItem.id,
							status: 1
						});
					} else {
						if (!this.content) {
							uni.showToast({
								title: '请输入驳回内容！',
								icon: 'none'
							})
							return;
						}
						this.serviceCardInfoExamineFunc({
							id: this.currentItem.id,
							status: 3,
							remark: this.content
						});
					}
				}

				if (this.currentType == 4) {
					if (this.current == 0) {
						this.examineFeedbackFunc({
							id: this.currentItem.id,
							status: 1,
						})
					} else {
						if (!this.content) {
							uni.showToast({
								title: '请输入驳回内容！',
								icon: 'none'
							})
							return;
						}
						this.examineFeedbackFunc({
							id: this.currentItem.id,
							status: 3,
							remark: this.content,
						})
					}
				}




			},
			examineFunc(obj) {
				examine(obj).then(res => {
					if (res.status == 200) {
						this.getExamineListFun()
						this.show = false;
					}
					uni.showToast({
						title: res.message,
						icon: 'none',
						duration: 4000
					})
				})
			},
			cancelClick() {
				this.show = false;
			},
			swipeActionClick(e, item) {
				this.current = e.index
				this.currentItem = item
				this.show = true;
			},

			getExamineListFun() {
				uni.showLoading({
					title: '加载中...'
				})
				getExamineList().then(res => {
					uni.hideLoading();
					this.dataList = res.data;
				})
			},
			toPage(item) {
				uni.navigateTo({
					url: '/pages/extend/connection/index_desc?id=' + item.id
				})
			},
			getServiceListFunc() {
				uni.showLoading({
					title: '加载中...'
				});
				
				findServiceGetExamineList().then(res => {
					uni.hideLoading();
					if (res.status == 200 && res.data) {
						this.serviceList = res.data.map(item => {
							return {
								id: item.id,
								title: item.title || '',
								des_content: item.des_content || '',
								des_images: item.des_images || '',
								case_content: item.case_content || '',
								case_images: item.case_images || '',
								qua_content: item.qua_content || '',
								qua_images: item.qua_images || '',
								cover_image: item.cover_image || '',
								avatar: '/static/images/avatar.png', // 默认头像
								name: '用户', // 默认用户名
								create_time: item.create_time || Date.now(),
								status: item.status || 2, // 1:已通过 2:审核中 3:已驳回
								see_number: item.see_number || 0,
								like_number: item.like_number || 0,
								remark: item.remark || ''
							};
						});
					} else {
						this.serviceList = [];
						uni.showToast({
							title: res.message || '获取数据失败',
							icon: 'none'
						});
					}
				}).catch(err => {
					uni.hideLoading();
					this.serviceList = [];
					uni.showToast({
						title: '获取数据失败',
						icon: 'none'
					});
					console.error('获取服务审核列表失败', err);
				});
			},
			viewServiceDetail(item) {
				// 跳转到服务详情页面
				uni.navigateTo({
					url: '/pages/extend/index/index_serve_desc?id=' + item.id
				});
			},
			getServiceStatusText(status) {
				switch (status) {
					case 1:
						return '已通过';
					case 2:
						return '审核中';
					case 3:
						return '已驳回';
					default:
						return '未知状态';
				}
			},
			serviceCardInfoExamineFunc(obj) {
				uni.showLoading({
					title: '处理中...'
				});
				
				findServiceExamine(obj).then(res => {
					uni.hideLoading();
					if (res.status == 200) {
						uni.showToast({
							title: obj.status === 1 ? '审核通过成功' : '审核驳回成功',
							icon: 'success'
						});
						// 刷新服务列表
						this.getServiceListFunc();
					} else {
						uni.showToast({
							title: res.message || '审核失败',
							icon: 'none'
						});
					}
					this.show = false;
				}).catch(err => {
					uni.hideLoading();
					uni.showToast({
						title: '审核失败，请稍后重试',
						icon: 'none'
					});
					console.error('服务审核失败', err);
					this.show = false;
				});
			},
			getFeedbackListFunc() {
				uni.showLoading({
					title: '加载中...'
				});
				
				PlatformFeedBackGetExamineList().then(res => {
					uni.hideLoading();
					if (res.status == 200) {
						this.feedbackList = res.data || [];
						
						// 处理数据，确保有用户信息
						this.feedbackList = this.feedbackList.map(item => {
							return {
								...item,
								avatar: item.avatar || '/static/images/avatar.png',
								name: item.name || '用户'
							};
						});
					} else {
						this.feedbackList = [];
						uni.showToast({
							title: res.message || '获取数据失败',
							icon: 'none'
						});
					}
				}).catch(err => {
					uni.hideLoading();
					this.feedbackList = [];
					uni.showToast({
						title: '获取数据失败',
						icon: 'none'
					});
					console.error('获取反馈审核列表失败', err);
				});
			},
			handleFeedbackSwipeClick(e, item) {
				this.current = e.index
				this.currentItem = item
				this.show = true;
			},
			previewFeedbackImage(images, index) {
				uni.previewImage({
					urls: images,
					current: images[index]
				});
			},
			getFeedbackTypeText(type) {
				if (type === 1) return '沙龙感想';
				if (type === 2) return '贵商反馈';
				if (type === 3) return '贵商寄语';
				return '未知类型';
			},
			getFeedbackStatusText(status) {
				if (status === 1) return '已通过';
				if (status === 2) return '审核中';
				if (status === 3) return '已驳回';
				return '未知状态';
			},
			examineFeedbackFunc(obj) {
				uni.showLoading({
					title: '处理中...'
				});
				
				PlatformFeedBackExamine(obj).then(res => {
					uni.hideLoading();
					if (res.status == 200) {
						uni.showToast({
							title: obj.status === 1 ? '审核通过成功' : '审核驳回成功',
							icon: 'success'
						});
						// 刷新反馈列表
						this.getFeedbackListFunc();
					} else {
						uni.showToast({
							title: res.message || '审核失败',
							icon: 'none'
						});
					}
					this.show = false;
					this.content = ''; // 清空驳回内容
				}).catch(err => {
					uni.hideLoading();
					uni.showToast({
						title: '审核失败，请稍后重试',
						icon: 'none'
					});
					console.error('反馈审核失败', err);
					this.show = false;
				});
			},
		}
	}
</script>

<style lang="scss" scoped>
	.news-content {
		display: flex;
		gap: 20rpx;
	}

	.news-cover {
		width: 200rpx;
		height: 150rpx;
		border-radius: 12rpx;
		flex-shrink: 0;
	}

	.news-info {
		flex: 1;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
	}

	.news-title {
		font-size: 30rpx;
		font-weight: bold;
		color: #333;
		line-height: 1.4;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 1;
		-webkit-box-orient: vertical;
	}

	.news-desc {
		font-size: 28rpx;
		color: #666;
		line-height: 1.4;
		margin-top: 10rpx;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
	}

	.news-footer {
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-top: 10rpx;
	}

	.news-label {
		font-size: 24rpx;
		color: #2965FF;
		background-color: rgba(41, 101, 255, 0.1);
		padding: 4rpx 16rpx;
		border-radius: 20rpx;
	}

	.news-time {
		font-size: 24rpx;
		color: #999;
	}

	.news-item {
		margin-bottom: 20rpx;
	}

	/* 侧滑按钮样式 */
	::v-deep .uni-swipe-action__btn {
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 28rpx;
	}

	.status-tabs {
		display: flex;
		gap: 20rpx;
		margin-bottom: 20rpx;
	}

	.status-tab {
		padding: 10rpx 20rpx;
		border: 1rpx solid #BBBBBB;
		border-radius: 6rpx;
		font-size: 28rpx;
		color: #333;
		cursor: pointer;

		&.status-tab-active {
			background-color: #00009E;
			color: white;
		}
	}

	.news-list {
		margin-top: 30rpx;
	}

	.box-moreM {
		text-align: center;
		line-height: 40rpx;
		width: 60rpx;
		height: 40rpx;
		background-color: #F5F5F5;
		border-radius: 6rpx;
	}

	.box-xq {
		border-radius: 6rpx;
		border: 1rpx solid #00009E;
		color: #00009E;
		font-weight: bold;
		text-align: center;
		font-size: 26rpx;
		width: 80rpx;
		height: 40rpx;
		background-color: #F1F1FF;
	}

	.box-img-for {
		display: flex;
		flex-wrap: wrap;
	}

	.box-fast {
		text-align: center;
		font-size: 28rpx;
		line-height: 60rpx;
		width: 140rpx;
		height: 60rpx;
		box-sizing: border-box;
		background-color: #E1E1FC;
		color: #00009E;
		font-weight: bold;
		border-radius: 6rpx;
	}

	.box-tabs {
		padding-top: 5rpx;
		z-index: 99999;
		padding-left: 20rpx;
		padding-right: 20rpx;
		display: flex;
		align-items: center;
		justify-content: space-around;
		font-weight: bold;
		font-size: 32rpx;
		box-sizing: border-box;
		width: 100%;
		height: 70rpx;
		opacity: 1;
		// background: #FFFFFF;
	}

	/* 优化后的导航栏样式 */
	.box-tabs-optimized {
		padding-top: 5rpx;
		z-index: 99999;
		box-sizing: border-box;
		width: 100%;
		height: 90rpx;
		opacity: 1;
	}

	.nav-scroll-view {
		width: 100%;
		height: 90rpx;
		white-space: nowrap;
	}

	.nav-scroll-content {
		display: flex;
		padding: 0 10rpx;
	}

	.box-tab-item {
		display: inline-flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		position: relative;
		padding: 0 30rpx;
		height: 90rpx;
	}

	.box-tabs-txt {
		margin-bottom: 20rpx;
	}

	.box-tab-active .box-tabs-txt {
		font-size: 34rpx;
		font-weight: bold;
	}

	.tab-indicator {
		position: absolute;
		bottom: 6rpx;
		top: auto;
	}

	.box-apply {
		padding: 20rpx;
		padding-left: 30rpx;
		padding-right: 30rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.box-card-main {
		padding: 20rpx;
	}

	.service-list {
		margin-top: 30rpx;
	}

	.service-item {
		background-color: #fff;
		border-radius: 12rpx;
		margin-bottom: 20rpx;
		box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
		overflow: hidden;
	}

	.service-header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 20rpx;
		border-bottom: 1rpx solid #f5f5f5;
	}

	.service-info {
		display: flex;
		align-items: center;
		flex: 1;
	}

	.service-avatar {
		width: 80rpx;
		height: 80rpx;
		border-radius: 50%;
		margin-right: 20rpx;
		background-color: #f5f5f5;
	}

	.service-meta {
		display: flex;
		flex-direction: column;
		flex: 1;
	}

	.service-name {
		font-size: 30rpx;
		font-weight: bold;
		color: #333;
		margin-bottom: 8rpx;
	}

	.service-time {
		font-size: 24rpx;
		color: #999;
	}

	.service-status {
		padding: 8rpx 20rpx;
		border-radius: 20rpx;
		font-size: 24rpx;
		color: #FFFFFF;
		background-color: #FFA500;
		margin-left: 20rpx;

		&.status-pending {
			background-color: #FFA500;
		}

		&.status-approved {
			background-color: #249444;
		}

		&.status-rejected {
			background-color: #dd524d;
		}
	}

	.service-content {
		display: flex;
		padding: 20rpx;
		gap: 20rpx;
		border-bottom: 1rpx solid #f5f5f5;
	}

	.service-cover {
		width: 200rpx;
		height: 150rpx;
		border-radius: 12rpx;
		flex-shrink: 0;
		background-color: #f5f5f5;
	}

	.service-brief {
		flex: 1;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
	}

	.service-title {
		font-size: 32rpx;
		font-weight: bold;
		color: #333;
		line-height: 1.4;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 1;
		-webkit-box-orient: vertical;
		margin-bottom: 10rpx;
	}

	.service-desc {
		font-size: 28rpx;
		color: #666;
		line-height: 1.4;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		margin-bottom: 15rpx;
	}

	.service-stats {
		display: flex;
		align-items: center;
		gap: 30rpx;
	}

	.stat-item {
		display: flex;
		align-items: center;
		font-size: 24rpx;
		color: #999;

		.iconfont {
			margin-right: 8rpx;
			font-size: 26rpx;
		}
	}

	.service-details {
		padding: 20rpx;
	}

	.detail-section {
		margin-bottom: 30rpx;

		&:last-child {
			margin-bottom: 0;
		}
	}

	.section-title {
		display: flex;
		align-items: center;
		margin-bottom: 15rpx;
		font-size: 28rpx;
		font-weight: bold;
		color: #333;

		.iconfont {
			margin-right: 10rpx;
			font-size: 30rpx;
			color: #1890ff;
		}
	}

	.section-content {
		background-color: #f8f9fa;
		border-radius: 8rpx;
		padding: 15rpx;
	}

	.content-text {
		font-size: 26rpx;
		color: #666;
		line-height: 1.6;
		margin-bottom: 15rpx;
	}

	.content-images {
		display: flex;
		flex-wrap: wrap;
		gap: 10rpx;
	}

	.detail-image {
		width: 160rpx;
		height: 160rpx;
		border-radius: 8rpx;
		background-color: #f5f5f5;
		object-fit: cover;
	}

	/* 平台反馈审核样式 */
	.feedback-list {
		margin-top: 20rpx;
	}

	.feedback-item {
		background-color: #fff;
		border-radius: 12rpx;
		margin-bottom: 20rpx;
		padding: 20rpx;
		box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
	}

	.feedback-header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-bottom: 15rpx;
	}

	.feedback-type {
		font-size: 24rpx;
		color: #2965FF;
		background-color: rgba(41, 101, 255, 0.1);
		padding: 4rpx 16rpx;
		border-radius: 20rpx;
	}

	.feedback-status {
		font-size: 24rpx;
		color: #FFFFFF;
		padding: 4rpx 16rpx;
		border-radius: 20rpx;
		
		&.status-pending {
			background-color: #FFA500;
		}
		
		&.status-approved {
			background-color: #249444;
		}
		
		&.status-rejected {
			background-color: #dd524d;
		}
	}

	.feedback-title {
		font-size: 32rpx;
		font-weight: bold;
		color: #333;
		margin-bottom: 12rpx;
	}

	.feedback-content {
		font-size: 28rpx;
		color: #666;
		line-height: 1.4;
		margin-bottom: 15rpx;
	}

	.feedback-images {
		display: flex;
		margin-bottom: 15rpx;
		position: relative;
	}

	.feedback-image {
		width: 160rpx;
		height: 160rpx;
		border-radius: 8rpx;
		margin-right: 12rpx;
		background-color: #f5f5f5;
		object-fit: cover;
	}

	.image-count {
		position: absolute;
		right: 12rpx;
		bottom: 0;
		background-color: rgba(0, 0, 0, 0.5);
		color: #fff;
		font-size: 24rpx;
		width: 160rpx;
		height: 160rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		border-radius: 8rpx;
	}

	.feedback-money {
		background-color: #FFF7E6;
		padding: 12rpx;
		border-radius: 8rpx;
		margin-bottom: 15rpx;
	}

	.money-label {
		font-size: 24rpx;
		color: #666;
	}

	.money-value {
		font-size: 28rpx;
		color: #F56C6C;
		font-weight: bold;
	}

	.feedback-suggest {
		background-color: #F8F9FA;
		padding: 12rpx;
		border-radius: 8rpx;
		margin-bottom: 15rpx;
	}

	.suggest-label {
		font-size: 24rpx;
		color: #666;
	}

	.suggest-content {
		font-size: 26rpx;
		color: #333;
	}

	.feedback-footer {
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-top: 20rpx;
	}

	.feedback-user {
		display: flex;
		align-items: center;
	}

	.user-avatar {
		width: 40rpx;
		height: 40rpx;
		border-radius: 50%;
		margin-right: 10rpx;
	}

	.user-name {
		font-size: 24rpx;
		color: #666;
	}

	.feedback-time {
		font-size: 24rpx;
		color: #999;
	}
</style>